package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BdCustclassMapper;
import com.ruoyi.system.domain.BdCustclass;
import com.ruoyi.system.service.IBdCustclassService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客户基本分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-08
 */
@Service
public class BdCustclassServiceImpl implements IBdCustclassService 
{
    @Autowired
    private BdCustclassMapper bdCustclassMapper;

    /**
     * 查询客户基本分类
     * 
     * @param pkCustclass 客户基本分类主键
     * @return 客户基本分类
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public BdCustclass selectBdCustclassByPkCustclass(String pkCustclass)
    {
        return bdCustclassMapper.selectBdCustclassByPkCustclass(pkCustclass);
    }

    /**
     * 查询客户基本分类列表
     * 
     * @param bdCustclass 客户基本分类
     * @return 客户基本分类
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<BdCustclass> selectBdCustclassList(BdCustclass bdCustclass)
    {
        return bdCustclassMapper.selectBdCustclassList(bdCustclass);
    }

    /**
     * 新增客户基本分类
     * 
     * @param bdCustclass 客户基本分类
     * @return 结果
     */
    @Override
    public int insertBdCustclass(BdCustclass bdCustclass)
    {
        return bdCustclassMapper.insertBdCustclass(bdCustclass);
    }

    /**
     * 修改客户基本分类
     * 
     * @param bdCustclass 客户基本分类
     * @return 结果
     */
    @Override
    public int updateBdCustclass(BdCustclass bdCustclass)
    {
        return bdCustclassMapper.updateBdCustclass(bdCustclass);
    }

    /**
     * 批量删除客户基本分类
     * 
     * @param pkCustclasss 需要删除的客户基本分类主键
     * @return 结果
     */
    @Override
    public int deleteBdCustclassByPkCustclasss(String pkCustclasss)
    {
        return bdCustclassMapper.deleteBdCustclassByPkCustclasss(Convert.toStrArray(pkCustclasss));
    }

    /**
     * 删除客户基本分类信息
     * 
     * @param pkCustclass 客户基本分类主键
     * @return 结果
     */
    @Override
    public int deleteBdCustclassByPkCustclass(String pkCustclass)
    {
        return bdCustclassMapper.deleteBdCustclassByPkCustclass(pkCustclass);
    }
}
